<template>
  <div class='goodsDesc-container'>
      <h1>{{goodsDesc.title}}</h1>
      <hr>
      <div v-html='goodsDesc.content'></div>
  </div>
</template>
<script>
import {Toast} from 'mint-ui';
    export default {
        data(){
            return {
                id:this.$route.params.id,
                goodsDesc:[]
            }
        },
        created(){
            this.getgoodsDesc()
        },
        methods:{
            getgoodsDesc(){
                 this.$http.get('api/goods/getdesc/'+this.id).then(result=>{
                   console.log(result.body);
                   if(result.body.status==0){
                       this.goodsDesc=result.body.message[0]
                   }else{
                       Toast('获取失败！');
                   }
               })
            }
        }
    }
</script>
<style lang="scss"> 
// 去掉scoped 图片的尺寸按父元素的大小才有效
    .goodsDesc-container{
        h1{
            font-size:18px;
            color:#226aff;
            text-align:center;
            line-height:50px;
        }
        img{
            width:100%;
        }
    }
</style>
